package string;

public class TrimDemo {
    public static void main(String[] args) {
        String str = "    hello world    ";
       // System.out.println(str.trim());

        String trim = str.trim();//trim()后得到新的字符串对象并存贮在trim变量中
        System.out.println(trim);//hello world 除去前后空白


    }
}
